
 /**trim the string*/
function trimAll(s) 
{
	if(s==null||s.length==0)
	    return "";
	while (s.substring(0,1) == ' ')
	{
		s = s.substring(1, s.length);
	}
	while (s.substring(s.length-1, s.length) == ' ')
	{
	    s = s.substring(0,s.length-1);
	}
	return s;
}

/*check whether is a number*/
function isNumber(text)
{
	//var letter1="123456789";
	var letter2="0123456789";
	var i;
	var c;
	if(text.length<=0)
		return false;
	//c=text.charAt(0);
	//not start with 123456789
	//if(letter1.indexOf(c)==-1)
	//	return false;
	for(i=0;i<text.length;i++)
	{
		c=text.charAt(i);
		if(letter2.indexOf(c)==-1)
		{
			return false;
		}	
	}
    return true;
}